<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center home_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub home_fd0_0'>
          <view class='flex flex-wrap align-center home_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='home_fd0_0_c1_c0'>工作台</text>
          </view>
          <view class='flex flex-wrap align-center justify-end home_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout">
        <view class='flex flex-wrap align-center justify-between flex-sub home_fd1_0' @tap.stop="handleJumpDiy"
          data-type="navigateTo" :data-url="`/pages/grzx/platformAnnouncement/platformAnnouncement`">
          <view class='flex flex-wrap align-center self-center justify-center'>

            <view class='flex  home_fd1_0_c0_c0'></view>

            <text class='home_fd1_0_c0_c1'>消息公告</text>
          </view>
          <view class='flex flex-wrap align-center self-center justify-center'>
            <text class='home_fd1_0_c1_c0'>更多</text>
            <image class='home_fd1_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"152.png"'></image>
          </view>
        </view>
        <view class='flex flex-direction align-stretch home_fd1_1' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/grzx/newDetail/newDetail?id=${item.aid}`" v-for="(item,index) in infoList" :key="index">
          <view class='flex flex-wrap align-center justify-between flex-sub'>
            <text class='home_fd1_1_c0_c0'>{{item.biaoti}}</text>
            <text class='home_fd1_1_c0_c1'>{{item.create_time}}</text>
          </view>
          <text class='home_fd1_1_c1'>{{item.jianjie}}</text>
        </view>
        <view class='flex flex-wrap align-center justify-between flex-sub home_fd1_0' @tap.stop="handleJumpDiy"
          data-type="navigateTo" :data-url="`/pages/grzx/list/list`">
          <view class='flex flex-wrap align-center self-center justify-center'>

            <view class='flex  home_fd1_0_c0_c0'></view>

            <text class='home_fd1_0_c0_c1'>待完成任务（{{total}}）</text>
          </view>
          <view class='flex flex-wrap align-center self-center justify-center'>
            <text class='home_fd1_0_c1_c0'>更多</text>
            <image class='home_fd1_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"152.png"'></image>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center">
        <view class='flex flex-direction align-stretch home_fd2_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
          v-for="(item,key0) in dataList" :key="key0" :data-url="`/pages/grzx/listDetail/listDetail?id=${item.aid}`">
          <view class='flex flex-wrap align-center justify-between flex-sub'>
            <text class='home_fd2_0_c0_c0'>任务标题：</text>
            <view class='text-cut home_fd2_0_c0_c1'>{{item.renwubiaoti}}</view>
          </view>
          <view class='flex flex-wrap align-center justify-between flex-sub home_fd2_0_c1'>
            <text class='home_fd2_0_c0_c0'>任务描述：</text>
            <view class='text-cut home_fd2_0_c0_c1'>{{item.renwumiaoshu}}</view>
          </view>
          <view class='flex flex-wrap align-center justify-between flex-sub' v-if="item.xiafashijian">
            <text class='home_fd2_0_c0_c0'>任务下发时间：</text>
            <text class='home_fd2_0_c0_c1'>{{item.xiafashijian}}</text>
          </view>
          <view class='flex flex-wrap align-center justify-between flex-sub home_fd2_0_c3' v-if="item.jiezhishijian">
            <text class='home_fd2_0_c0_c0'>任务截至时间：</text>
            <text class='home_fd2_0_c0_c1'>{{item.jiezhishijian}}</text>
          </view>
          <view class='flex flex-wrap align-center justify-between home_fd2_0_c4'>
            <text class='home_fd2_0_c4_c0'>{{item.zhuangtai_name}}</text>
            <button class='home_fd2_0_c4_c1'>查看任务</button>
          </view>
        </view>

      </view>

      <!---flex布局flex布局结束-->
      <fu-empty-ui v-if="dataList.length==0"></fu-empty-ui>

    </view>
    <!-- <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
      :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty> -->
    <image @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/grzx/kaoqindaka/kaoqindaka`"
      class='home_fd2_1_c0' mode="aspectFit" :src='STATIC_URL+"155.png"'>
    </image>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        infoList: [],
        dataList: [],
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        total: 0
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      }
    },
    watch: {},
    onLoad(options) {
      if (global.appTabBarType) this.toHomeDiy()


    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getList()
      if (this.isLogin) {
        this.getListFunc()
      }

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      getListFunc() {
        this.minixPagingListsApi = global.apiUrls.post66262dc451a36;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          zhuangtai: '1'
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      },
      getList() {
        this.$api.post(global.apiUrls.post662790a9a6887, {
          list_rows: '3'
        }).then(res => {
          if (res.data.code == 1) {
            this.infoList = res.data.data.data
          }
        })
        if (this.isLogin) {
          this.$api.post(global.apiUrls.post66262dc451a36, {
            zhuangtai: '1'
          }).then(res => {
            if (res.data.code == 1) {
              this.total = res.data.data.total
            }
          })
        }

      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .home_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .home_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .home_fd0_0_c0 {
    width: 120rpx;
  }

  .home_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .home_fd1_1_c1 {
    font-size: 24rpx;
    margin: 24rpx 0rpx 0rpx 0rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .home_fd1_1_c0_c1 {
    color: rgba(102, 102, 102, 1);
  }

  .home_fd1_1_c0_c0 {
    font-weight: 600;
  }

  .home_fd1_1 {
    background: var(--benbenbgColor1);
    width: 710rpx;
    background-size: 100% auto;
    border-radius: 16rpx;
    margin: 0rpx auto 24rpx auto;
    padding: 24rpx;
  }

  .home_fd1_0_c1_c1 {
    width: 22rpx;
    height: 26rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .home_fd1_0_c1_c0 {
    color: var(--benbenFontColor2);
    margin: 0rpx 12rpx 0rpx 0rpx;
  }

  .home_fd1_0_c0_c1 {
    font-size: 32rpx;
    font-weight: 600;
  }

  .home_fd1_0_c0_c0 {
    background: rgba(0, 119, 255, 1);
    width: 6rpx;
    height: 30rpx;
    margin: -4rpx 10rpx 0rpx 10rpx;
  }

  .home_fd1_0 {
    line-height: 100rpx;
    height: 100rpx;
    margin: 0rpx auto 0rpx auto;
    width: 710rpx;
  }

  .home_fd2_1_c0 {
    position: fixed;
    z-index: 999;
    bottom: calc(300rpx + var(--window-bottom));
    right: 30rpx;
    width: 96rpx;
    height: 96rpx;
  }

  .home_fd2_1 {}

  .home_fd2_0_c4_c1 {
    background: rgba(0, 119, 255, 1);
    border-radius: 33rpx 33rpx 33rpx 33rpx;
    width: 160rpx;
    line-height: 64rpx;
    font-size: 28rpx;
    color: #fff;
    height: 64rpx;
  }

  .home_fd2_0_c4_c0 {
    background: rgba(255, 128, 0, 0.1);
    color: rgba(255, 128, 0, 1);
    font-size: 22rpx;
    width: 98rpx;
    line-height: 40rpx;
    border-radius: 4rpx 4rpx 4rpx 4rpx;
    text-align: center;
  }

  .home_fd2_0_c4 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .home_fd2_0_c3 {
    border-bottom: 1px solid #eee;
    margin: 24rpx 0rpx 0rpx 0rpx;
    padding: 0rpx 0rpx 24rpx 0rpx;
  }

  .home_fd2_0_c1 {
    margin: 24rpx 0rpx 24rpx 0rpx;
  }

  .home_fd2_0_c0_c1 {
    color: var(--benbenFontColor0);
    font-weight: 600;
    max-width: 450rpx;
  }

  .home_fd2_0_c0_c0 {
    color: rgba(102, 102, 102, 1);
  }

  .home_fd2_0 {
    background: var(--benbenbgColor1);
    width: 710rpx;
    background-size: 100% auto;
    border-radius: 16rpx;
    margin: 0rpx auto 24rpx auto;
    padding: 24rpx;
  }
</style>
